import request from "@/utils/requestDetail";
import { Data, userInfoData } from "./model/detailModel";

// 枚举
enum Api {
  // 获取头部 GET /m-revision/page/album/v2/queryAlbumPage/18724442
  GetHeader = "/m-revision/page/album/v2/queryAlbumPage",

  // 猜你喜欢 GET /revision/category/v2/albums
  GetLike = "/revision/category/v2/albums",

  // 节目列表 GET /m-revision/common/album/queryAlbumTrackRecordsByPage
  GetPargram = "/m-revision/common/album/queryAlbumTrackRecordsByPage",

  // 主播信息 GET /m-revision/common/user/queryUserInfo/109114414
  GetUserInfo = "/m-revision/common/user/queryUserInfo",

  // 主播的作品GET /m-revision/common/anchor/queryAnchorAlbumsByPage
  GetGoods = "/m-revision/common/anchor/queryAnchorAlbumsByPage",

  // 相似专辑 GET /revision/search/seo
  GetSeo = "/revision/search/seo",

  // 用户评论GET /m-revision/common/album/queryAlbumCommentsByPage
  GetComments = "/m-revision/common/album/queryAlbumCommentsByPage",
}

// 获取头部数据和简介
export const getHeaderApi = (id: any) => {
  return request.get<any, Data>(Api.GetHeader + `/${id}`);
};

// 获取主播信息
export const getUserInfoApi = (id: number, params: any) => {
  return request.get<any, userInfoData>(Api.GetUserInfo + `/${id}`, {
    params: params,
  });
};

// 获取节目列表
export const getPargramApi = (reqParams: any) => {
  return request.get<any, any>(Api.GetPargram, {
    params: reqParams,
  });
};

// 获取主播的作品
export const getGoodsApi = (reqGood: any) => {
  return request.get<any, any>(Api.GetGoods, {
    params: reqGood,
  });
};

// 、获取相似专辑
export const getSeoApi = (params: any) => {
  return request.get<any, any>(Api.GetSeo, {
    params: params,
  });
};

// 获取评论
export const getCommentApi = (commentsReq: any) => {
  return request.get<any, any>(Api.GetComments, {
    params: commentsReq,
  });
};

// 猜你喜欢
export const getLikeApi = (reqLike: any) => {
  return request.get<any, any>(Api.GetLike, {
    params: reqLike,
  });
};
